package com.ruoyi.activityLog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.activityLog.mapper.ActivityLogMapper;
import com.ruoyi.activityLog.domain.ActivityLog;
import com.ruoyi.activityLog.service.IActivityLogService;

/**
 * 活动记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-14
 */
@Service
public class ActivityLogServiceImpl implements IActivityLogService 
{
    @Autowired
    private ActivityLogMapper activityLogMapper;

    /**
     * 查询活动记录
     * 
     * @param id 活动记录主键
     * @return 活动记录
     */
    @Override
    public ActivityLog selectActivityLogById(Long id)
    {
        return activityLogMapper.selectActivityLogById(id);
    }

    /**
     * 查询活动记录列表
     * 
     * @param activityLog 活动记录
     * @return 活动记录
     */
    @Override
    public List<ActivityLog> selectActivityLogList(ActivityLog activityLog)
    {
        return activityLogMapper.selectActivityLogList(activityLog);
    }

    /**
     * 新增活动记录
     * 
     * @param activityLog 活动记录
     * @return 结果
     */
    @Override
    public int insertActivityLog(ActivityLog activityLog)
    {
        activityLog.setCreateTime(DateUtils.getNowDate());
        return activityLogMapper.insertActivityLog(activityLog);
    }

    /**
     * 修改活动记录
     * 
     * @param activityLog 活动记录
     * @return 结果
     */
    @Override
    public int updateActivityLog(ActivityLog activityLog)
    {
        activityLog.setUpdateTime(DateUtils.getNowDate());
        return activityLogMapper.updateActivityLog(activityLog);
    }

    /**
     * 批量删除活动记录
     * 
     * @param ids 需要删除的活动记录主键
     * @return 结果
     */
    @Override
    public int deleteActivityLogByIds(Long[] ids)
    {
        return activityLogMapper.deleteActivityLogByIds(ids);
    }

    /**
     * 删除活动记录信息
     * 
     * @param id 活动记录主键
     * @return 结果
     */
    @Override
    public int deleteActivityLogById(Long id)
    {
        return activityLogMapper.deleteActivityLogById(id);
    }
}
